#ifndef DEBUG_LOGGER_H_
#define DEBUG_LOGGER_H_

#define DEBUGLOG0(P1) {\
	time_t t ## __LINE__ = time(0); \
	struct tm * now = localtime( & t ## __LINE__); \
	fprintf(stderr, "%i:%i:%i PID[%08X] %s:%i ", now->tm_hour, now->tm_min, now->tm_sec, pthread_self(), __FILE__, __LINE__);\
	fprintf(stderr, P1); }

#define DEBUGLOG1(FORMAT, P1) {\
	time_t t ## __LINE__ = time(0); \
	struct tm * now = localtime( & t ## __LINE__); \
	fprintf(stderr, "%i:%i:%i PID[%08X] %s:%i ", now->tm_hour, now->tm_min, now->tm_sec, pthread_self(), __FILE__, __LINE__);\
	fprintf(stderr, FORMAT, P1); }

#define DEBUGLOG2(FORMAT, P1, P2) {\
	time_t t ## __LINE__ = time(0); \
	struct tm * now = localtime( & t ## __LINE__); \
	fprintf(stderr, "%i:%i:%i PID[%08X] %s:%i ", now->tm_hour, now->tm_min, now->tm_sec, pthread_self(), __FILE__, __LINE__);\
	fprintf(stderr, FORMAT, P1, P2); }

#define DEBUGLOG3(FORMAT, P1, P2, P3) {\
	time_t t ## __LINE__ = time(0); \
	struct tm * now = localtime( & t ## __LINE__); \
	fprintf(stderr, "%i:%i:%i PID[%08X] %s:%i ", now->tm_hour, now->tm_min, now->tm_sec, pthread_self(), __FILE__, __LINE__);\
	fprintf(stderr, FORMAT, P1, P2, P3); }

#define DEBUGLOG4(FORMAT, P1, P2, P3, P4) {\
	time_t t ## __LINE__ = time(0); \
	struct tm * now = localtime( & t ## __LINE__); \
	fprintf(stderr, "%i:%i:%i PID[%08X] %s:%i ", now->tm_hour, now->tm_min, now->tm_sec, pthread_self(), __FILE__, __LINE__);\
	fprintf(stderr, FORMAT, P1, P2, P3, P4); }

#define DEBUGLOG5(FORMAT, P1, P2, P3, P4, P5) {\
	time_t t ## __LINE__ = time(0); \
	struct tm * now = localtime( & t ## __LINE__); \
	fprintf(stderr, "%i:%i:%i %08X %s:%i ", now->tm_hour, now->tm_min, now->tm_sec, pthread_self(), __FILE__, __LINE__);\
	fprintf(stderr, FORMAT, P1, P2, P3, P4, P5); }

#define DEBUGLOG0_(P1) {\
	fprintf(stderr, P1); }

#define DEBUGLOG1_(FORMAT, P1) {\
	fprintf(stderr, FORMAT, P1); }

#define DEBUGLOG2_(FORMAT, P1, P2) {\
	fprintf(stderr, FORMAT, P1, P2); }

#define DEBUGLOG3_(FORMAT, P1, P2, P3) {\
	fprintf(stderr, FORMAT, P1, P2, P3); }

#define DEBUGLOG4_(FORMAT, P1, P2, P3, P4) {\
	fprintf(stderr, FORMAT, P1, P2, P3, P4); }

#define DEBUGLOG5_(FORMAT, P1, P2, P3, P4, P5) {\
	fprintf(stderr, FORMAT, P1, P2, P3, P4, P5); }

#endif
